//---------------------------------------------------------------------
// <copyright file="EdmFunctionReferenceExpression.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//---------------------------------------------------------------------

using Microsoft.Data.Edm.Expressions;

namespace Microsoft.Data.Edm.Library.Expressions
{
    /// <summary>
    /// Represents an EDM function reference expression.
    /// </summary>
    public class EdmFunctionReferenceExpression : EdmElement, IEdmFunctionReferenceExpression
    {
        private readonly IEdmFunction referencedFunction;

        /// <summary>
        /// Initializes a new instance of the <see cref="EdmFunctionReferenceExpression"/> class.
        /// </summary>
        /// <param name="referencedFunction">Referenced function</param>
        public EdmFunctionReferenceExpression(IEdmFunction referencedFunction)
        {
            EdmUtil.CheckArgumentNull(referencedFunction, "referencedFunction");
            this.referencedFunction = referencedFunction;
        }

        /// <summary>
        /// Gets the referenced function.
        /// </summary>
        public IEdmFunction ReferencedFunction
        {
            get { return this.referencedFunction; }
        }

        /// <summary>
        /// Gets the kind of this expression.
        /// </summary>
        public EdmExpressionKind ExpressionKind
        {
            get { return EdmExpressionKind.FunctionReference; }
        }
    }
}
